UVa 10921 - Find the Telephone

Contents

  1. 1. Problem
  2. 2. Code

Problem

題目網址
一個一個對照過去而已…

Code

UVa 10921UVa 10921 - Find the Telephone
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

#include<cstdio>

int main()
{
char map[27] = "22233344455566677778889999";
char c;
while ((c = getchar()) != EOF)
{
if (c == '\n')
putchar('\n');
else if (c == '-' || c == '1' || c == '0')
putchar(c);
else
putchar(map[c - 'A']);
}

return 0;
}